<!--  -->
<template>
  <div class="panel main pd20">
    <div class="msg">HI,{{ userInfo.name }}, 你已经是我们的正式会员</div>
    <div class="layui-row lauui-col-space20">
      <div class="layui-col-md6">
        <div class="panel border mr10">
          <div class="title">我的会员信息</div>
          <div class="content">
            <p>
              积分经验值:
              <cite class="numbe">{{ userInfo.favs }}</cite>
            </p>
            <p>
              您当前为:
              <cite class="layui-badge fly-badge-vip">
                {{ userInfo.isVip === '0' ? '非VIP' : 'VIP' + userInfo.isVip }}
              </cite>
            </p>
          </div>
        </div>
      </div>
      <div class="layui-col-md6">
        <sign class="border"></sign>
      </div>
      <div class="layui-col-md12 mt20">
        <div class="panel border" style="height: auto">
          <div class="title">快捷方式</div>
          <div class="content2">
            <ul class="layui-rol layui-col-space10">
              <li class="layui-col-sm3 lay-col-xs4">
                <a href="">
                  <div class="layui-icon layui-set shortcut"></div>
                  <span>修改</span>
                </a>
              </li>
              <li class="layui-col-sm3 lay-col-xs4">
                <a href="">
                  <div class="layui-icon layui-set shortcut"></div>
                  <span>修改</span>
                </a>
              </li>
              <li class="layui-col-sm3 lay-col-xs4">
                <a href="">
                  <div class="layui-icon layui-set shortcut"></div>
                  <span>修改</span>
                </a>
              </li>
              <li class="layui-col-sm3 lay-col-xs4">
                <a href="">
                  <div class="layui-icon layui-set shortcut"></div>
                  <span>修改</span>
                </a>
              </li>
              <li class="layui-col-sm3 lay-col-xs4">
                <a href="">
                  <div class="layui-icon layui-set shortcut"></div>
                  <span>修改</span>
                </a>
              </li>
              <li class="layui-col-sm3 lay-col-xs4">
                <a href="">
                  <div class="layui-icon layui-set shortcut"></div>
                  <span>修改</span>
                </a>
              </li>
              <li class="layui-col-sm3 lay-col-xs4">
                <a href="">
                  <div class="layui-icon layui-set shortcut"></div>
                  <span>修改</span>
                </a>
              </li>
            </ul>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Sign from '@/components/sidebar/Sign'
import { getInfor } from '@/api/user'
export default {
  name: 'center',
  components: {
    Sign
  },
  data () {
    return {
    };
  },
  computed: {
    userInfo () {
      return this.$store.state.userInfo
    }
  },

  mounted () {
    this.getInfo()
  },

  methods: {
    getInfo () {
      getInfor({
        uid: this.$store.state.userInfo._id
      }).then((res) => {
        if (res.code === 200) {
          console.log(res.data);
          this.$store.commit('setUserInfo', res.data)
        }
      })
    }
  }
}

</script>
<style scoped lang='scss' >
@media screen and(max-width: 768px) {
  .panel {
    &.main {
      margin: 0 !important;
    }
  }
}
.panel {
  border-radius: 2px;
  background-color: #fff;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 5%);
  transition: all 0.2s;
  &.main {
    margin: 0 0 10px 225px;
  }
}
.msg {
  background-color: #f8f8f8;
  color: #666;
  padding: 10px 15px;
  margin-bottom: 20px;
}
.boder {
  border: 1px solid #e6e6e6;
}
.pd20 {
  padding: 20px;
}
.title {
  height: 50px;
  line-height: 50px;
  border-bottom: 1px dotted #e9e9e9;
  font-size: 14px;
  padding: 0 15px;
  color: #333;
}
.content {
  padding: 18px 15px;
  height: 50px;
  line-height: 26px;
  font-size: 14px;
  color: #666;
}
.mt20 {
  margin-top: -10px;
}
.mr10 {
  margin-right: 10px;
}
.shortcut {
  background-color: seagreen;
  width: 100%;
  height: 60px;
  line-height: 60px;
  text-align: center;
  color: #fff;
  border-radius: 2px;
  font-size: 30px;
}
li {
  text-align: center;
  padding: 5px;
}
.numbe {
  color: red;
}
</style>